package com.techblor.serviceconsumerribbon.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Ribbon服务消费客户端
 */
@RestController
public class ServiceConsumerRibbonClient {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping(value = "/serviceProviderData")
    public String serviceProviderData() {
        String result = this.restTemplate.getForObject("http://microservice-service-provider/serviceProviderData", String.class);
        return result;
    }

}
